(describe-function-1): If the source is `loaddefs.el', look for the
authorMarkus Rost <rost@math.uni-bielefeld.de>
Wed, 8 May 2002 18:02:28 +0000 (18:02 +0000)
committerMarkus Rost <rost@math.uni-bielefeld.de>
Wed, 8 May 2002 18:02:28 +0000 (18:02 +0000)
real source.  This is necessary only for defaliases.

lisp/help-fns.el

index e27e6fc119a11c2d81f693f8ba16a35336552d77..af0fa9e73a9abde5b86b0805bdc797ef3bbd0a14 100644 (file)
@@ -210,6 +210,19 @@ and the file name is displayed in the echo area."
              (help-xref-button 1 'help-function def)))))
     (or file-name
        (setq file-name (symbol-file function)))
+    (when (equal file-name "loaddefs.el")
+      ;; Find the real def site of the preloaded function.
+      ;; This is necessary only for defaliases.
+      (let ((location
+            (condition-case nil
+                (find-function-search-for-symbol function nil "loaddefs.el") 
+              (error nil))))
+       (when location
+         (with-current-buffer (car location)
+           (goto-char (cdr location))
+           (when (re-search-backward
+                  "^;;; Generated autoloads from \\(.*\\)" nil t)
+             (setq file-name (match-string 1)))))))
     (cond
      (file-name
       (princ " in `")